<?php
include_once("functions/db_manipulate.php");

if (init()) {
  redirect("?action=index");
  exit();
}

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=<?= getMessageByKey("default.charset") ?>"/>
  <title><?= getMessageByKey("registration.title") ?></title>
  <link rel="stylesheet" type="text/css" href="css/navigation.css">
  <link rel="stylesheet" type="text/css" href="css/menu.css">
  <link rel="stylesheet" type="text/css" href="css/common.css">
  <link rel="stylesheet" type="text/css" href="css/login.css">
  <script src="resources/jquery.js"></script>
  <meta name="keywords"
        content="<?= getMessageByKey('indexflies.keywords')?>">
  <meta name="description" content="<?= getMessageByKey('registration.description')?>">
</head>
<body>

<?php
include_once("menu.php");
?>

<div class="maincommon">

  <div class="regheader">
    <?= getMessageByKey("registration.form.header") ?>
  </div>

  <div class="userinfodiv">
    <form action="?action=reghand" method="post" id="loginform">

      <div class="tr">
        <div class="td">
          <?= getMessageByKey("user.firstname") ?>
        </div>
        <div class="td">
          <input type="text" required maxlength="50" name="fname" class="forminput" required
                 style="box-shadow: 0 0 10px rgba(255,0,0,1)">
        </div>
        <div class="commentfield">
          <?= getMessageByKey("registration.form.firstname") ?>
        </div>
      </div>
      <div class="tr">
        <div class="td">
          <?= getMessageByKey("user.lastname") ?>
        </div>
        <div class="td">
          <input type="text" maxlength="50" name="lname" class="forminput" required style="box-shadow: 0 0 10px rgba(255,0,0,1)">
        </div>
        <div class="commentfield">
          <?= getMessageByKey("registration.form.lastname") ?>
        </div>
      </div>
      <div class="tr">
        <div class="td">
          <?= getMessageByKey("user.login") ?>
        </div>
        <div class="td">
          <input type="text" name="login" maxlength="20" class="forminput" required style="box-shadow: 0 0 10px rgba(255,0,0,1)">
        </div>
        <div class="commentfield">
          <?= getMessageByKey("registration.form.login") ?>
        </div>
      </div>
      <div class="tr">
        <div class="td">
          <?= getMessageByKey("user.email") ?>
        </div>
        <div class="td">
          <input type="text" maxlength="40" name="email" class="forminput" required style="box-shadow: 0 0 10px rgba(255,0,0,1)">
        </div>
        <div class="commentfield">
          <?= getMessageByKey("registration.form.email") ?>
        </div>
      </div>
      <div class="tr">
        <div class="td">
          <?= getMessageByKey("user.icq") ?>
        </div>
        <div class="td">
          <input type="text" maxlength="20" name="icq" class="forminput">
        </div>
        <div class="commentfield">
          <?= getMessageByKey("registration.form.icq") ?>
        </div>
      </div>
      <div class="tr">
        <div class="td">
          <?= getMessageByKey("user.skype") ?>
        </div>
        <div class="td">
          <input type="text" maxlength="10" name="skype" class="forminput">
        </div>
        <div class="commentfield">
          <?= getMessageByKey("registration.form.skype") ?>
        </div>
      </div>
      <div class="tr">
        <div class="td">
          <?= getMessageByKey("user.mobile") ?>
        </div>
        <div class="td">
          <input type="text" maxlength="20" name="mobile" class="forminput" required style="box-shadow: 0 0 10px rgba(255,0,0,1)">
        </div>
        <div class="commentfield">
          <?= getMessageByKey("registration.form.mobile") ?>
        </div>
      </div>
      <div class="tr">
        <div class="td">
          <?= getMessageByKey("user.address") ?>
        </div>
        <div class="td">
          <input type="text" maxlength="40" name="address" class="forminput">
        </div>
      </div>
      <div class="tr">
        <div class="td">
          <?= getMessageByKey("user.work") ?>
        </div>
        <div class="td">
          <input type="text" maxlength="20" name="work" class="forminput">
        </div>
      </div>
      <div class="tr">
        <div class="td">
          <?= getMessageByKey("user.methods") ?>
        </div>
        <div class="td">
          <input type="text" maxlength="40" name="methods" class="forminput">
        </div>
      </div>
      <div class="tr">
        <div class="td">
          <?= getMessageByKey("user.birth") ?>
        </div>
        <div class="td">
          <input type="date" maxlength="40" name="birth" class="forminput">
        </div>
        <div class="commentfield">
          <?= getMessageByKey("registration.form.birth") ?>
        </div>
      </div>
      <div class="tr">
        <div class="td">
          <?= getMessageByKey("registration.form.rules.ask") ?>
        </div>
        <div class="td">
          <input type="checkbox" name="agree" class="passsavecheckbox"
                 onclick="$('#register').fadeToggle('slow')">
        </div>
      </div>

      <div class="buttondiv">
        <div class="button" onclick="location.href='index.php'" style="margin-left: 10px;">
          <?= getMessageByKey("button.general.cancel") ?>
        </div>
        <div class="button" id="register" onclick="$('#loginform').submit()"
             style="display: none; width: 140px;">
          <?= getMessageByKey("button.registration") ?>
        </div>

      </div>
    </form>
  </div>


</div>

<?php
include_once("navigation.php");
?>

</body>
</html>
